package com.duck.communication.service.impl;

import com.duck.communication.dao.OperateDao;
import com.duck.communication.service.OperateService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.HashMap;

@Service
@RequiredArgsConstructor
public class OperateServiceImpl implements OperateService {

    private final OperateDao operateDao;

    @Override
    public Integer addLike(HashMap<String, Object> like) {
        return operateDao.addLike(like);
    }

    @Override
    public Integer cancelLike(HashMap<String, Object> like) {
        return operateDao.deleteLike(like);
    }

    @Override
    public Integer countLike(HashMap<String, Object> like) {
        return operateDao.selectLike(like);
    }

    @Override
    public Integer addCollect(String userId, Integer postId) {
        return operateDao.addCollect(userId,postId);
    }

    @Override
    public Integer cancelCollect(String userId, Integer postId) {
        return operateDao.deleteCollect(userId,postId);
    }

    @Override
    public Integer selectCollectCount(Integer postId) {
        return operateDao.selectCollectCount(postId);
    }
}
